<!DOCTYPE html>
<html lang="en" style="background: #F1F1F1 !important;overflow-y: scroll">
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="white">
    <link rel="stylesheet" href="../dist/main.css">

</head>
<body  style="background: #F1F1F1 !important;">
<div id="mine">
   <div class="infoBox">
       <div class="mainBox">
             <div class="info">
                  <div class="zs"></div>
                 <div class="noBinding noB" style="display: none">
                     <p>暂时无法使用跟单系统,</p>
                     <p>请先绑定MT5账号。</p>
                     <div class="btns">
                         <button class="mui-btn mui-btn-warning mui-btn-outlined" id="bidingBtn">绑定MT5账号</button>
                     </div>
                 </div>
                 <div class="noBinding shening" style="display: none">
                     <p>暂时无法使用跟单系统,</p>
                     <p>您的账号正在审核中</p>
                     <!--<div class="btns">-->
                         <!--<button class="mui-btn mui-btn-warning mui-btn-outlined" id="bidingBtn">绑定MT5账号</button>-->
                     <!--</div>-->
                 </div>
                 <div class="noBinding resulat" style="display: none">
                     <p>暂时无法使用跟单系统,</p>
                     <p>您的账号已被驳回</p>
                     <!--<div class="btns">-->
                     <!--<button class="mui-btn mui-btn-warning mui-btn-outlined" id="bidingBtn">绑定MT5账号</button>-->
                     <!--</div>-->
                 </div>
                 <div class="hasBinding mainBox" style="display: none">
                     <div class="mui-row  clearFix">
                         <div class="mui-col-sm-8 mui-col-xs-8" style="padding-top: 0.35rem">
                             <span id="name">Honor</span>
                             <span class="followMt follower" style="display: none">跟随者账号</span>
                             <span class="mowMt mower"  style="display: none">信号源账号</span>
                             <br>
                             <div id="addAutograph">
                                 <span id="addAutographSpan">添加个性签名</span>
                                 <img src="../img/user_redact(32_32).png" alt="">
                             </div>

                         </div>
                         <div class="mui-col-sm-4 mui-col-xs-4" style="padding-top: 0.35rem;height: 2rem;overflow: hidden"  >
                            <div class="tx" style="float: right" id="picker">
                                 <div class="camera">
                                     <i class="mui-icon mui-icon-camera"></i>
                                 </div>
                            </div>
                         </div>

                     </div>
                     <div id="follower" style="display: none" class="follower">
                         <div class="mt5InfoBox">
                             <img src="../img/user_name(32_32).png" alt="">
                             <span class="mtName">/</span>
                             <span class="login">/</span>
                         </div>
                         <div class="mt5InfoBox">
                             <img src="../img/user_lever(32_32).png" alt="">
                             <span>1:100</span>
                         </div>
                         <div class="mt5InfoBox" style="margin-right: 0">
                             <img src="../img/user_time(32_32).png" alt="">
                             <span class="registerDay">0天</span>
                         </div>
                     </div>

                     <div class="mower" style="display: none">
                         <div class="mt5InfoBox">
                             <img src="../img/user_name(32_32).png" alt="">
                             <span id="mtName">/</span>
                             <span id="login">/</span>
                         </div>
                         <div class="mt5InfoBox">
                             <img src="../img/user_lever(32_32).png" alt="">
                             <span>1:100</span>

                         </div>
                         <br>
                         <div class="mt5InfoBox">
                             <img src="../img/user_time(32_32).png" alt="">
                             <span id="registerDay">0天</span>

                         </div>

                         <div class="mt5InfoBox">
                             <img src="../img/user_follow(32_32).png" alt="">
                             <span id="follow">0</span>
                         </div>

                         <div class="mt5InfoBox" style="margin-right: 0">
                             <img src="../img/user_heart(32_32).png" alt="">
                             <span id="collection">0</span>
                         </div>
                     </div>
                     <hr>
                     <div class="mui-row  clearFix moreMt5">
                         <div class="mui-col-sm-6 mui-col-xs-6 wrap" >
                             <div class="mui-row  clearFix">
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     初始资金：
                                 </div>
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     <span class="gray" id="initialMoney">0</span>
                                 </div>
                             </div>

                         </div>
                         <div class="mui-col-sm-6 mui-col-xs-6 wrap">
                             <div class="mui-row  clearFix">
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     净利润：
                                 </div>
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     <span class="green" id="profit">$0</span>
                                 </div>
                             </div>
                         </div>
                         <div class="mui-col-sm-6 mui-col-xs-6 wrap">
                             <div class="mui-row  clearFix">
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     累计入金：
                                 </div>
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     <span class="gray" id="recharge">0</span>
                                 </div>
                             </div>
                         </div>
                         <div class="mui-col-sm-6 mui-col-xs-6 wrap">
                             <div class="mui-row  clearFix">
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     累计盈利：
                                 </div>
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     <span class="green" id="payOff">0</span>
                                 </div>
                             </div>
                         </div>
                         <div class="mui-col-sm-6 mui-col-xs-6 wrap">
                             <div class="mui-row  clearFix">
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     累计出金：
                                 </div>
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     <span class="gray" id="draw">0</span>
                                 </div>
                             </div>
                         </div>
                         <div class="mui-col-sm-6 mui-col-xs-6 wrap">
                             <div class="mui-row  clearFix">
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     累计亏损：
                                 </div>
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     <span class="green" id="loss">0</span>
                                 </div>
                             </div>
                         </div>
                         <div class="mui-col-sm-6 mui-col-xs-6 wrap">
                             <div class="mui-row  clearFix">
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     累计库存费：
                                 </div>
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     <span class="gray" id="overnightFee">0</span>
                                 </div>
                             </div>
                         </div>
                         <div class="mui-col-sm-6 mui-col-xs-6 wrap">
                             <div class="mui-row  clearFix">
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     当前余额：
                                 </div>
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     <span class="green" id="initBalance">0</span>
                                 </div>
                             </div>
                         </div>
                         <div class="mui-col-sm-6 mui-col-xs-6 wrap">
                             <div class="mui-row  clearFix">
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     累计手续费：
                                 </div>
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     <span class="gray" id="commission">0</span>
                                 </div>
                             </div>
                         </div>
                         <div class="mui-col-sm-6 mui-col-xs-6 wrap">
                             <div class="mui-row  clearFix">
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     信用额度：
                                 </div>
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     <span class="gray" id="credit">0</span>
                                 </div>
                             </div>
                         </div>
                         <div class="mui-col-sm-6 mui-col-xs-6 wrap mower" style="display: none">
                             <div class="mui-row  clearFix">
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     跟单资金：
                                 </div>
                                 <div class="mui-col-sm-6 mui-col-xs-6">
                                     <span class="gray" id="documentaryFunds">0</span>
                                 </div>
                             </div>
                         </div>


                     </div>





                 </div>

             </div>
           <div class="tool">
               <div class="mui-content">
                   <div class="mui-row">
                       <div class="mui-col-sm-3 mui-col-xs-3  center" id="audit">
                           <div class="toolBox">
                               <img src="../img/mineBtn_1(50_50).png" alt="">
                           </div>
                           <p>审核</p>
                       </div>
                       <div class="mui-col-sm-3 mui-col-xs-3  center" id="bidingBtn">
                           <div class="toolBox" style="background-color: #dff5ff;">
                               <img src="../img/mineBtn_2(50_50).png" alt="">
                           </div>
                           <p>绑定</p>
                       </div>
                       <div class="mui-col-sm-3 mui-col-xs-3  center" id="getZhList">
                           <div class="toolBox" style="background-color: #fff1d5;">
                               <img src="../img/mineBtn_3(50_50).png" alt="">
                           </div>
                           <p>账号</p>
                       </div>
                       <div class="mui-col-sm-3 mui-col-xs-3  center" id="setPage">
                           <div class="toolBox" style="background-color: #d6fee9;">
                               <img src="../img/mineBtn_4(50_50).png" alt="">
                           </div>
                           <p>设置</p>
                       </div>



                   </div>
               </div>
           </div>



       </div>



   </div>
    <div class="charts mower">

        <form class="mui-input-group">
            <div class="mui-input-row mui-radio mui-left">
                <label>余额变化</label>
                <input name="style" type="radio" checked="" value="right-none">
            </div>
            <!--<div class="mui-input-row mui-radio mui-left">-->
                <!--<label>跟单资金变化</label>-->
                <!--<input name="style" type="radio" value="right-icon">-->
            <!--</div>-->

        </form>

        <div class="mainBox">
            <div class="chartsBox">

                    <div class="mui-switch mui-active">
                        <div class="mui-switch-handle"></div>
                    </div>
                 <div id="echarts" style="width:110%;height:110%;margin-left: -0.5rem;margin-top: -1rem">

                 </div>
            </div>
        </div>


    </div>
    <div class="commnyBox" style="margin-top: 0.27rem">
        <div class="box">
            <div class="mainBox">
                <img src="../img/leftEmail(40_40).png" alt="">
                <span>邮箱账号</span>
                <span id="companyEmail" style="float: right"></span>
            </div>


        </div>
        <div class="box" id="rule">
            <div class="mainBox">
                <img src="../img/leftRule(40_40).png" alt="">
                <span>资金要求与规则提示</span>
               <i class="mui-icon mui-icon-arrowright"></i>
            </div>
        </div>
        <div class="box" id="commpanyInfo">
            <div class="mainBox">
                <img src="../img/leftAboutUs(40_40).png" alt="">
                <span>关于我们</span>
                <i class="mui-icon mui-icon-arrowright"></i>
            </div>
        </div>
    </div>

</div>



<view></view>

</body>
</html>
<script src="../dist/main.js"></script>
<script src="../dist/layui.js"></script>

<script>
 var dayType="w";
    (function () {
        $("title").html(mt5Obj.title)
        bolBinding()
        if( sessionStorage.getItem("bolBindingMT5")=="false"){
            $(".noB").show()
        }else if(sessionStorage.getItem("bolBindingMT5")=="1"){
            $(".shening").show()

        }else if(sessionStorage.getItem("bolBindingMT5")=="2"){
            $(".resulat").show()
        }
            else{
            $(".hasBinding").show()
        }
        $("#companyEmail").html(mt5Obj.companyEmail);



        info()
        balaceArr()
    })();
    //个人信息
    function  info() {
        $.ajax({
            url:mt5Obj.allUrl+"mt/user/myInfo ",
            success:function (data) {
                for(x in data.data){
                    infoGe(x,data.data[x])


                }
                if(data.data.type==0){
                    $(".mower").show();

                }else{
                    $(".follower").show();

                }
                $("#companyEmail").html(data.data.mail)
                $("#mtName2").html(1234)
                if(data.data.icon){
                    $("#picker").css("background","url("+data.data.icon+")");
                    $("#picker").css("backgroundSize","cover")
                }

                if(data.data.explain){
                 $("#addAutographSpan").html(data.data.explain)

                }
                 console.log(data.data.icon)


            }
        })
    }
    //绑定
    mui("body").on('tap','#bidingBtn',function(){
        bolBinding()
        if(sessionStorage.getItem("bolBindingMT5")=="1"){
            mui.alert("您有账号正在审核中，审核通过后可绑定新的MT5账号");
        }else{
            goBinding();

        }

    })
    //获取账号列表
 mui("body").on('tap','#getZhList',function(){
   goUrl("zhList","4")
 })

    //资金要求与规则提示
    mui("body").on('tap','#rule',function(){
       goUrl("genExplain","4")

    })
//    关于我们
    mui("body").on('tap','#commpanyInfo',function(){
        goUrl("companyInfo","4")

    })
//    设置号
    mui("body").on('tap','#setPage',function(){
        goUrl("setPage","4")

    })
    //审核
    mui("body").on('tap','#audit',function(){
        goUrl("AuditList","4")

    })
    layui.use('upload', function() {
        var upload = layui.upload;
        //执行实例
        var uploadInst = upload.render({
            elem: '#picker' //绑定元素
            ,
            url: mt5Obj.allUrl+'mt/user/upload/icon' //上传接口
            ,
            field: "uploadFile",

            done: function(res) {
                //上传完毕回调
                if(res.success) {
                    window.location.reload();
                } else {
                    mui.alert("修改失败");
                }

            },
            error: function() {
                //请求异常回调
            }
        });
    });
  //添加个性签名
    mui("body").on('tap','#addAutograph',function(){

        if ($("#addAutographSpan")=="添加个性签名"){

        }
        mui.confirm("<textarea   id='myAutograph'  placeholder='请输入个性签名（20个字以内）' maxlength='20'></textarea>", "请输入个性签名", ["取消", "确定"],
            function(e) {
                if(e.index == "1") {
                   $.ajax({
                       url:mt5Obj.allUrl+"mt/user/saveExplain",
                       type:"post",
                       data:{
                           explain:$("#myAutograph").val()
                       },
                       success:function (data) {
                         if(data.data){
                             info();
                         }
                       }
                   })

                }
            }, 'div')

    })
    //选择周/月
    mui('.mui-switch').each(function() { //循环所有toggle
        this.addEventListener('toggle', function(event) {

            if(!event.detail.isActive){
                dayType="m";
            }else{
                dayType="w";
            }

            balaceArr();
        });
    });
   //余额变化
 function  balaceArr() {
     var myChart = echarts.init(document.getElementById('echarts'));
     var balanceArr = [];
     $.ajax({
         url:mt5Obj.allUrl+"mt/user/blanceChange",
         data:{
             type:dayType
         },
         success:function (data) {
             // var times=[[1522306819000, 2], [1522306919000, 1], [1522307019000, 3], [1522307119000, 1], [1522307120000, 1],[1522307230000, 1], [1522302230000, 1], [1522307430000, 1], [1522407230000, 1]];
             for(x in data.data) {
                 var str = data.data[x].createTime
                 balanceArr.push({
                     name: str,
                     value:[str,data.data[x].blance]
                 })

             }
             setTimeout(function () {
             option = {
                 tooltip: {
                     trigger: 'axis',
                     formatter: function(params) {
                         var profit;
                         params = params[0].data;
                         var day=params.name
                         if(params.value[1]){
                             if(params.value[1]>=0){
                                 profit='$'+retrunZero(params.value[1])
                             }else {
                                 profit='-$'+retrunZero(params.value[1]).toString().split("-")[1].toLocaleString()
                             }
                         }
                         return day+ "</br>" + profit

                     },
                     extraCssText: 'background-color: rgba("0,0,0,.4");border: solid 0px #ffc555;font-size: 16px;text-align:center;',
                     axisPointer: {
                         animation: false
                     },
                     labelLine: {
                         normal: {
                             show: false
                         },
                     }
                 },
                 xAxis: {
                     type: 'time',
                     boundaryGap: false,
                     splitLine: {
                         show: false
                     },
                     axisLine:{
                         show:false
                     },
                     axisTick: {
                         show: false,

                     },
                     axisLabel:{
                         color:"#ffffff"
                     }
                 },
                 yAxis: {
                     type: 'value',
                     axisTick: {
                         show: false
                     },
                     show:false,
                     splitLine: {
                         lineStyle: {
                             color: '#ffc555',
                             width: 0

                         }
                     },

                 },
                 series: [{
                     data:balanceArr,
                     type: 'line',
                     areaStyle: {
                         color:'rgba(255, 255, 255, 0.4)'
                     },

                     itemStyle: {
                         normal: {
                             lineStyle: {
                                 color: "#ffffff"
                             },
                             color: '#ffffff',
                             symbol: 'pin',
                             symbolSize: 16
                         }
                     },
                     symbolSize: "8",
                     symbol: "circle"

                 }]
             };

             myChart.setOption(option);

         },10)

         }

     })

 }








</script>




